# Copyright 2022-2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

package(
    default_visibility = ["//visibility:public"],
)

licenses(["notice"])

cc_library(
    name = "numbers",
    hdrs = ["numbers.h"],
    visibility = ["//visibility:public"],
)

cc_library(
    name = "params",
    srcs = ["params.cc"],
    hdrs = ["params.h"],
    visibility = ["//visibility:public"],
    deps = [
        ":numbers",
        ":types",
        "//ink_stroke_modeler/internal:validation",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_test(
    name = "params_test",
    srcs = ["params_test.cc"],
    deps = [
        ":numbers",
        ":params",
        ":types",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_library(
    name = "stroke_modeler",
    srcs = ["stroke_modeler.cc"],
    hdrs = ["stroke_modeler.h"],
    deps = [
        ":params",
        ":types",
        "//ink_stroke_modeler/internal:internal_types",
        "//ink_stroke_modeler/internal:loop_contraction_mitigation_modeler",
        "//ink_stroke_modeler/internal:position_modeler",
        "//ink_stroke_modeler/internal:stylus_state_modeler",
        "//ink_stroke_modeler/internal:utils",
        "//ink_stroke_modeler/internal:wobble_smoother",
        "//ink_stroke_modeler/internal/prediction:input_predictor",
        "//ink_stroke_modeler/internal/prediction:kalman_predictor",
        "//ink_stroke_modeler/internal/prediction:stroke_end_predictor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
    ],
)

cc_test(
    name = "stroke_modeler_fuzz_test",
    srcs = ["stroke_modeler_fuzz_test.cc"],
    tags = [
        "no-windows-clang-cl",
    ],
    deps = [
        ":params",
        ":stroke_modeler",
        ":types",
        "@com_google_fuzztest//fuzztest",
        "@com_google_fuzztest//fuzztest:fuzztest_gtest_main",
    ],
)

cc_test(
    name = "stroke_modeler_test",
    srcs = ["stroke_modeler_test.cc"],
    deps = [
        ":params",
        ":stroke_modeler",
        ":types",
        "//ink_stroke_modeler/internal:type_matchers",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_library(
    name = "types",
    srcs = ["types.cc"],
    hdrs = ["types.h"],
    visibility = ["//visibility:public"],
    deps = [
        "//ink_stroke_modeler/internal:validation",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

cc_test(
    name = "types_test",
    srcs = ["types_test.cc"],
    deps = [
        ":numbers",
        ":types",
        "//ink_stroke_modeler/internal:type_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_googletest//:gtest_main",
    ],
)
